//grab the top level window
var topWin = window;
try {
while (topWin !== top) {
topWin = topWin.parent;
}
} catch (e) {
console.error("couldn't access the top window");
};
//global variable for de-duping tracker
if (topWin.__SNT_TRACKER_CALLED__ === undefined) {
topWin.__SNT_TRACKER_CALLED__ = false;
};
//needed for currentExecutingScript
!function(t,r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?module.exports=r():t.currentExecutingScript=r()}(this||window,function(){function t(t){return t?t.replace(/^\s+$|\s+$/g,"").replace(/\s\s+/g," "):""}function r(t,r){var e,n=null;if(r=r||p,"string"==typeof t&&t)for(e=r.length;e--;)if(r[e].src===t){n=r[e];break}return n}function e(r,e){var n,a,i=null,c=t(r);if(e=e||p,r&&c)for(n=e.length;n--;)if(!e[n].hasAttribute("src")&&(a=t(e[n].text),-1!==a.indexOf(c))){if(i){i=null;break}i=e[n]}return i}function n(t){var r,e,n=null;for(t=t||p,r=0,e=t.length;e>r;r++)if(!t[r].hasAttribute("src")){if(n){n=null;break}n=t[r]}return n}function a(t,r){var e,n,i=null,c="number"==typeof r;return r=c?Math.round(r):0,"string"==typeof t&&t&&(c?e=t.match(/(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/):(e=t.match(/^(?:|[^:@]*@|.+\)@(?=data:text\/javascript|blob|http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),e&&e[1]||(e=t.match(/\)@(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))),e&&e[1]&&(r>0?(n=t.slice(t.indexOf(e[0])+e[0].length),i=a(n,r-1)):i=e[1])),i}function i(){return null}function c(){return null}function o(){if(0===p.length)return null;var t,i,c,l,f,b=[],v=o.skipStackDepth||1,w=null;for(t=0;t
0) {
//need to choose different tags to avoid collisions
for (vert in altVerticals) {
var tempAUN = AD_UNIT_NAME.replace(oldVertical, altVerticals[vert]);
if (typeof topWin.__SNT_WIDGETS__[tempAUN] === "undefined"
|| topWin.__SNT_WIDGETS__[tempAUN] === 0) {
VERTICAL = altVerticals[vert];
topWin.__SNT_WIDGETS__[tempAUN] = 1;
AD_UNIT_NAME = tempAUN;
break;
}
}
}
var mobileWidget = (AD_UNIT_NAME.indexOf("mobile") !== -1) ? true : false;
var config = (typeof AD_CONFIGS[VERTICAL] !== "undefined") ? AD_CONFIGS[VERTICAL][AD_UNIT_NAME] : "";
var REALVU_CONFIG = {
s: (typeof config["realvu"] !== "undefined") ? config["realvu"]["s"] : "",
c: (typeof config["realvu"] !== "undefined") ? config["realvu"]["c"] : "",
p: (typeof config["realvu"] !== "undefined") ? config["realvu"]["p"] : ""
},
OPENX_AUID = (typeof config["openx"] !== "undefined") ? config["openx"]["auid"] : "",
OPENX_CS = (typeof config["openx"] !== "undefined") ? config["openx"]["cs"] : "",
BREAL_ID = (typeof config["breal"] !== "undefined") ? config["breal"]["id"] : "",
CRITEO_ZONEID = (typeof config["criteo"] !== "undefined") ? config["criteo"]["zoneid"] : "",
RUBICON_KW = (typeof config["rubicon"] !== "undefined") ? config["rubicon"]["rp_kw"] : "",
RUBICON_SITE = (typeof config["rubicon"] !== "undefined") ? config["rubicon"]["rp_site"] : "",
RUBICON_ZONESIZE = (typeof config["rubicon"] !== "undefined") ? config["rubicon"]["rp_zonesize"] : "",
NATIVE_PIXEL_ID = (typeof config["native"] !== "undefined") ? config["native"]["pixelid"] : "",
NATIVE_ZONE_ID = (typeof config["native"] !== "undefined") ? config["native"]["zoneid"] : "",
NATIVE_CHANNEL_ID = (typeof config["native"] !== "undefined") ? config["native"]["channelid"] : "",
NATIVE_ASYNC_ZID = (typeof config["native"] !== "undefined") ? config["native"]["asynczid"] : "",
SOVRN_ZONE_ID = (typeof config["sovrn"] !== "undefined") ? config["sovrn"]["zoneid"] : "",
GAMUT_ZONE_ID = (typeof config["gamut"] !== "undefined") ? config["gamut"]["zoneid"] : "",
GAMUT_SITE_ID = (typeof config["gamut"] !== "undefined") ? config["gamut"]["siteid"] : "";
var NATIVE_SIZE_W = "0",
NATIVE_SIZE_H = "0",
CHECK_NATIVE_SIZE = "true";
if (CHECK_NATIVE_SIZE === "true" && VERTICAL === "finance") {
NATIVE_SIZE_W = "300";
NATIVE_SIZE_H = "250";
}
var protocolToUse = (location.protocol == "https:") ? "https" : "http";
var pathForSecure = (location.protocol == "https:") ? "s" : "l";
function activate_tracker(attachToMe) {
trackerSource = protocolToUse + "://content.synapsys.us/t/1436337860/tracker.js";
console.log("__SNT_TRACKER_CALLED__ > ",topWin.__SNT_TRACKER_CALLED__);
//insert GA via GTM
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
"gtm.start" :
new Date().getTime(),
event : "gtm.js"
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src =
"//www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-WDG7BV");
if (!topWin.__SNT_TRACKER_CALLED__) {
topWin.__SNT_TRACKER_CALLED__ = true;
//add tracker script
_$.getScript(trackerSource + "?dom=" + DOMAIN + "&remn=" + false + "&r=" + Math.floor((Math.random() * 100000000000000000) + 10000))
.done(function(script, textStatus) {
console.log("Tracker loaded");
})
.fail(function(jqxhr, settings, exception) {
console.log("Tracker failed to load");
setTimeout(function() {
//try again in 500ms
activate_tracker(attachToMe);
}, 500);
});
//add geo script
/* if (Math.floor(Math.random() * 100000) < 1) {
_$("", {src: protocolToUse + "://api.synapsys.us/etc/gc/"}).appendTo(attachToMe);
} */
//insert Clicky
_$.getScript("//static.getclicky.com/js")
.done(function(script, textStatus) {
try{
clicky.init(CLICKY_ID);
console.log("Clicky initialized");
}catch(e){
console.log("Error initializing clicky", e);
};
})
.fail(function(jqxhr, settings, exception){
console.log("Clicky source code failed to load");
});
//activate the GA pageview event
dataLayer.push({
"event": "pageview",
"Domain Name": DOMAIN,
"Vertical": VERTICAL
});
};
//activate the GA widet-load event
dataLayer.push({
"event": "widget-load",
"Domain Name": DOMAIN,
"Widget Type": PF_WIDGET_TYPE
});
};
var _$;
if (topWin.jQuery === undefined || topWin.jQuery.fn.jquery !== "2.2.2") {
var st = document.createElement("script");
st.setAttribute("type","text/javascript");
st.setAttribute("src", protocolToUse + "://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js");
if (st.readyState) {
st.onreadystatechange = function () { //
if (this.readyState == "complete" || this.readyState == "loaded") { scriptLoadHandler(); };
};
} else { st.onload = scriptLoadHandler; };
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(st);
} else {
_$ = topWin.jQuery;
main();
};
function scriptLoadHandler() {
_$ = window.jQuery.noConflict(true);
/*
_$.when(
_$.getScript(protocolToUse + "://content.synapsys.us/gl.js"),
_$.Deferred(function(deferred){
_$(deferred.resolve);
})
).done(function(){
// when all scripts are loaded... fire main function
main();
});
*/
main();
};
// clean up the main function, please
function main() {
var currentScript = currentExecutingScript(),
div_main_widget,
ifr_main_widget,
div_ad_stack,
div_ad_queue = [],
cycleQueue,
clearQueue,
dequeue_ad,
passback = false,
receivePassbackCall,
setupPassbackCatcher,
paint_house,
pattern_house_ad_div = "div_house_ad",
paint_realvu,
pattern_realvu_div = "div_realvu_ad_",
paint_openx,
pattern_openx_div = "div_openx_ad_",
paint_breal,
pattern_breal_div = "div_breal_ad_",
pattern_breal_ifr = "ifr_breal_ad_",
paint_conversant,
pattern_conversant_div = "div_conversant_ad_",
pattern_conversant_ifr = "ifr_conversant_ad_",
paint_criteo,
pattern_criteo_div = "div_criteo_ad_",
pattern_criteo_ifr = "ifr_criteo_ad_",
paint_rubicon,
pattern_rubicon_div = "div_rubicon_ad_",
pattern_rubicon_ifr = "ifr_rubicon_ad_",
paint_native,
pattern_native_div = "div_native_ad_",
pattern_native_ifr = "ifr_native_ad_",
paint_sovrn,
pattern_sovrn_div = "div_sovrn_ad_",
pattern_sovrn_ifr = "ifr_sovrn_ad_",
paint_adblade,
pattern_adblade_div = "div_adblade_ad_",
paint_gamut,
pattern_gamut_div = "div_gamut_ad_",
pattern_gamut_ifr = "ifr_gamut_ad_",
paint_sekindo,
pattern_sekindo_div = "div_sekindo_ad_",
pattern_sekindo_ifr= "ifr_sekindo_ad_",
renderAdTag,
guid,
timer_queue_paint = null,
timer_passback_catcher = null,
timer_onLoad = null,
timer_visibility = null,
timer_adCycle = null,
timer_realvu = null,
timer_openx = null,
timer_ims = null,
show_div,
playAdCycle,
hoverTrigger,
isElementVisible,
checkVisibility,
prevOnDisplay = "none",
adOnDisplay = "none",
onLoad = { //upon initial load
iter: 0,
order: [
'realvu',
'native',
'openx',
'sovrn',
'gamut',
'realvu',
'native',
'openx',
'sovrn',
'gamut' ],
timing: [
19000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000),
29000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000),
29000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000),
19000 + Math.ceil(Math.random() * 2000) ],
replay: false
},
onHover = { //upon widget mouse-over
iter: 0,
order: [
'realvu',
'native' ],
timing: [
19000 + Math.ceil(Math.random() * 2000),
16000 + Math.ceil(Math.random() * 2000) ],
replay: true
},
/* onLowVis = { //when ad area leaves the screen
iter: 0,
order: [
"house"
],
timing: [
delay_standard
],
replay: false
}, */
onVisible = { //when ad area enters the screen
iter: 0,
order: [
'realvu',
'native' ],
timing: [
19000 + Math.ceil(Math.random() * 2000),
16000 + Math.ceil(Math.random() * 2000) ],
replay: true //whether the onVisible cycle should repeat continuously
},
delay_paint = 1, //how much time allowed for pre-loading ads
delay_visibility = 3500, //how much time to wait before running the onVisible
delay_onLoad = onLoad.timing.reduce(function(a, b) { //how much time the initial ad displays
return a + b;
}),
delay_standard = 33000, //how much time to display standard ads
delay_realvu = 33000,
delay_openx = 33000,
delay_ims = 33000,
delay_breal = 33000,
delay_conversant = 33000,
delay_criteo = 33000,
browserVisible = true,
getTopIframe;
//if this is not the first time this widget has been called, offset the onload order by the number of times it has been loaded minus 1
onLoad.iter += duplicateWidgets;
_$(window).load(function() {
window.loaded = true;
});
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
};
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
};
var mainId = "div_pfwidget_" + PF_WIDGET_TYPE + guid();
div_main_widget = _$("", {
class: "div_pfwidget",
id: mainId,
"ad_unit_name": AD_UNIT_NAME
}).css({
display: "block",
height: PF_WIDGET_HEIGHT,
width: PF_WIDGET_WIDTH,
margin: 0,
border: 0,
overflow: "hidden",
position: "relative",
backgroundColor: "#fff",
"z-index": 0
}).insertBefore(_$(currentScript));
if (PF_WIDGET_HEIGHT > 0) { //for ad-stack only implementations
ifr_main_widget = _$("", {
id: "ifr_pfwidget_" + PF_WIDGET_TYPE,
frameBorder: "0",
scrolling: "no",
allowTransparency: "true",
src: PF_WIDGET_URL
}).css({
display: "block",
height: PF_WIDGET_HEIGHT,
width: PF_WIDGET_WIDTH,
margin: 0,
"margin-left": PF_WIDGET_OFFSET_X + "px",
"margin-top": PF_WIDGET_OFFSET_Y + "px",
border: 0,
overflow: "hidden",
"z-index": 0
}).appendTo(div_main_widget);
};
//no ad-stack height means no ad-stack; widget only
if (AD_STACK_HEIGHT > 0) {
div_ad_stack = _$("", {
class: "div_ad_stack",
id: "div_ad_stack_" + guid()
}).css({
width: AD_STACK_WIDTH,
height: AD_STACK_HEIGHT,
overflow: "hidden",
position: "relative",
margin: 0,
"margin-left": AD_STACK_OFFSET_X + "px",
"margin-top": AD_STACK_OFFSET_Y + "px",
backgroundColor: "#fff",
"background-repeat": "no-repeat",
"background-position": "center",
"background-image": "none"
}).insertAfter(div_main_widget);
};
// activate_tracker(div_ad_stack);
activate_tracker(div_main_widget);
//interval to maintain the size of the ad and widget divs
var size_checker = setInterval(function() {
if (PF_WIDGET_HEIGHT > 0 && div_main_widget.height() != PF_WIDGET_HEIGHT) {
div_main_widget.height(PF_WIDGET_HEIGHT);
};
if (PF_WIDGET_WIDTH > 0 && div_main_widget.width() != PF_WIDGET_WIDTH) {
div_main_widget.width(PF_WIDGET_WIDTH);
};
if (AD_STACK_HEIGHT > 0 && div_ad_stack.height() != AD_STACK_HEIGHT) {
div_ad_stack.height(AD_STACK_HEIGHT);
};
if (AD_STACK_WIDTH > 0 && div_ad_stack.width() != AD_STACK_WIDTH) {
div_ad_stack.width(AD_STACK_WIDTH);
};
}, 100);
//adds the specified ad to the queue, and after the specified delay, at the specified z-index, simultaneously displays the new ad and removes the old ad (if any)
cycleQueue = function(ad_network, zInd, delay) {
if (prevOnDisplay == "none" || (adOnDisplay == "onHover" && prevOnDisplay != "onHover")) {
delay = 0;
} else {
delay = delay || delay_paint;
};
switch (ad_network) {
case "house":
div_ad_queue.push(paint_house(zInd));
break;
case "realvu":
_$("div[id*='realvu" + REALVU_CONFIG.p + "']").attr("id", "realvu" + guid());
div_ad_queue.push(paint_realvu(zInd));
break;
case "openx":
div_ad_queue.push(paint_openx(zInd));
break;
case "breal":
div_ad_queue.push(paint_breal(zInd));
break;
case "conversant":
div_ad_queue.push(paint_conversant(zInd));
break;
case "criteo":
div_ad_queue.push(paint_criteo(zInd));
break;
case "rubicon":
div_ad_queue.push(paint_rubicon(zInd));
break;
case "native":
div_ad_queue.push(paint_native(zInd));
break;
case "sovrn":
div_ad_queue.push(paint_sovrn(zInd));
break;
case "adblade":
div_ad_queue.push(paint_adblade(zInd));
break;
case "gamut":
div_ad_queue.push(paint_gamut(zInd));
break;
case "sekindo":
div_ad_queue.push(paint_sekindo(zInd));
break;
default:
console.log("PF_ERROR: Unknown ad_network " + ad_network + ". No ad drawn.");
break;
}; //add to these as new ad networks are added to the ad-stack
//keep these next two lines only until pre-loading is working
div_ad_queue[0].css({"z-index" : zInd + 1});
show_div(div_ad_queue[div_ad_queue.length - 1]);
timer_queue_paint = setTimeout(function () {
// if (div_ad_queue[1]) div_ad_queue[1].css({"z-index" : 51});
// show_div(div_ad_queue[0]);
if (div_ad_queue.length > 1) {
div_ad_queue[0].slideUp(function () {
clearQueue(div_ad_queue.length - 1);
});
};
}, delay); // end of timer_queue_paint
}; // >> end of cycleQueue()
//remove all ads waiting in the queue except the ad located at the given index
clearQueue = function(ind) {
if (div_ad_queue[ind]) {
for (var i = div_ad_queue.length - 1; i >= 0; i--) {
if (i != ind) {
//on the mobile widget implementation, we're only loading the "house ad" once, and hiding it instead of fully destroying it
if (mobileWidget === false || (mobileWidget === true && div_ad_queue[i][0].id.indexOf(pattern_house_ad_div) === -1)) {
div_ad_queue[i].remove();
}
div_ad_queue.splice(i, 1);
};
};
};
}; // >> end of clearQueue
paint_house = function(zInd) {
//for mobile widget implementation, we'll only load it the first time
var tempHouseAd = div_ad_stack.children("div[id*='" + pattern_house_ad_div + "']");
if (typeof tempHouseAd[0] === "undefined") {
var rnd = guid();
var div_house = _$("", {
id: pattern_house_ad_div + rnd,
"rand": rnd
}).css({
backgroundColor: "transparent",
width: AD_STACK_WIDTH,
height: AD_STACK_HEIGHT,
overflow: "hidden",
position: "absolute",
top: 0,
left: 0,
opacity: 0,
"z-index": zInd
}).appendTo(div_ad_stack);
var houseAdUrl;
/* if (top.location.host.substr(top.location.host.indexOf("finance.") == 0)) {
houseAdUrl = top.location.protocol + top.location.host + "/list-companies?id=236&type=location&price-low=1&market-cap-low=1&order=mk-desc";
} else {
houseAdUrl = top.location.protocol + "//finance." + top.location.host.substr(top.location.host.indexOf("www.") + 4) + "/list-companies?id=236&type=location&price-low=1&market-cap-low=1&order=mk-desc";
};
div_house.append(_$("", {
href: houseAdUrl,
target: "_blank"
}).append("
")); */
if (mobileWidget === true) {
houseAdUrl = PF_WIDGET_URL;
} else {
houseAdUrl = '//w1.synapsys.us/images/?w=' + AD_STACK_WIDTH + '&h=' + AD_STACK_HEIGHT;
}
var ifr_house = _$("", {
id: rnd,
src: houseAdUrl,
scrolling: "no",
frameBorder: 0,
allowTransparency: "true"
}).css({
width: "100%",
height: "100%"
}).appendTo(div_house);
} else {
var div_house = tempHouseAd;
}
return div_house;
};
paint_realvu = function(zInd) {
var rnd = guid();
var div_realvu = _$("", {
id: pattern_realvu_div + REALVU_CONFIG.p + rnd,
"pfw_type": PF_WIDGET_TYPE,
"rand": rnd
}).css({
backgroundColor: "transparent",
width: AD_STACK_WIDTH,
height: AD_STACK_HEIGHT,
overflow: "hidden",
position: "absolute",
top: 0,
left: 0,
opacity: 0,
"z-index": zInd
}).appendTo(div_ad_stack);
// window.realvu_units = window.realvu_units || [];
window.realvu_units = [];
window.realvu_units.push(REALVU_CONFIG);
_$("", {
id: "realvu" + REALVU_CONFIG.p
})
.appendTo(div_realvu);
_$("")
.appendTo(div_realvu)
.on("load",function() {
var currentObject = div_realvu.find('iframe[name="realvu_ad_unit"]');
_$(currentObject).on("load",function() {
_$(currentObject).off("load");
realvu_st = (new Date()).getTime();
});
})
.attr("src", protocolToUse + "://pr.realvu.net/realvu_pr2.js");
return div_realvu;
}; // >> end of paint_realvu()
paint_openx = function(zInd) {
var rnd = guid();
var div_openx = _$("", {
id: pattern_openx_div + OPENX_AUID + rnd,
"pfw_type": PF_WIDGET_TYPE,
"rand": rnd
}).css({
backgroundColor: "transparent",
width: AD_STACK_WIDTH,
height: AD_STACK_HEIGHT,
overflow: "hidden",
position: "absolute",
top: 0,
left: 0,
opacity: 0,
"z-index": zInd
}).appendTo(div_ad_stack);
var adTagHead = "",
adTagBody = "\r\n